package Echart

import (
	"WebSvr/modules/common"
	json "encoding/json"
	io "io/ioutil"
	"os"
)

func CreateS2CMsg(pC2Sjson *common.C2SJson, choseTable string) (s2cmsg GetS2CMsger, err error) {
	switch choseTable {
	case "pc_status":
		s2cmsg = new(S2CPcInfoJson)
		s2cmsg.setTitleText("cpu-men", "总内存大小", "center")
		s2cmsg.setToolbox()
		s2cmsg.setToolTip("axis", false)
		err = s2cmsg.getS2CData(pC2Sjson, "pc_status")
		
	default:
		break
	}

	return s2cmsg, err
}

//通用函数
func Wite2Json(v interface{}) {
	body, dataErr := json.Marshal(v)
	if dataErr == nil {
		io.WriteFile("test.json", body, os.ModeAppend)
	} else {

	}
}
